package com.weijin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.weijin.mapper.ExceptionRecordInfoMapper;
import com.weijin.model.entities.ExceptionRecordInfo;
import com.weijin.service.IExceptionInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 异常打卡服务实现类
 *
 * @Author WeiJin
 * @Version 1.0
 * @Date 2025/3/28 14:18
 */
@Service
public class ExceptionInfoServiceImpl implements IExceptionInfoService {

    @Autowired
    private ExceptionRecordInfoMapper exceptionRecordInfoMapper;


    @Override
    public List<ExceptionRecordInfo> queryAllExceptionInfo() {
        LambdaQueryWrapper<ExceptionRecordInfo> wrapper = new LambdaQueryWrapper<>();
        return exceptionRecordInfoMapper.selectList(wrapper);
    }

    @Override
    public List<ExceptionRecordInfo> queryUserExceptionInfo(String userId) {
        LambdaQueryWrapper<ExceptionRecordInfo> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ExceptionRecordInfo::getUserId, userId);
        return exceptionRecordInfoMapper.selectList(wrapper);
    }
}
